package com.sherlockHolmes.init.base.adapter;

import com.sherlockHolmes.init.service.CommunityService;
import com.sherlockHolmes.init.service.SearchService;
import com.sherlockHolmes.init.service.UserInfoService;
import org.springframework.stereotype.Component;


import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.HashMap;

@Component
public class TypeAdapter {
    @Resource
    private UserInfoService userInfoService;//用户
    @Resource
    private CommunityService communityService;//圈子
    //帖子
    private HashMap<String, SearchService> hashMap=new HashMap<>();
    @PostConstruct
    public void init(){
        hashMap.put("article",userInfoService);
        hashMap.put("image",communityService);
    }
    public SearchService getType(String type){
        return hashMap.get(type);
    }
}
